<?php

use Illuminate\Database\Seeder;

class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        DB::table('users')->truncate();
        $data = [];
        for ($i=1; $i <= 50; $i++) { 
            $data[] = [
                'username' => 'user'.$i,
                'password' => 'user'.$i,
                'email' => 'user'.$i.'@qq.com',
                'age' => $i,
                'sex' => ['男生','女生'][rand(0,1)]
            ];
        }
        DB::table('users')->insert($data);
    }
}
